#pragma once

#include <list>
#include "Thread.h"
#include "Task.h"


namespace yazi{
namespace thread{

class TaskDispatcher : public Thread{
public:
    TaskDispatcher();
    virtual ~TaskDispatcher();

    void init(int size);
    void assign(Task* task);
    void handle(Task* task);
    virtual void run();

private:
    std::list<Task*> m_tasks;
};


}}